#!/usr/bin/python3.5

# -*- coding: utf-8 -*-


def insertSort(arr):
    for i in range(1,len(arr)):
        for j in range(i,0,-1):
            if arr[j] < arr[j-1]:
                arr[j-1], arr[j] = arr[j], arr[j-1]
            else:
                break
    return arr





if __name__ =="__main__":

    a = [2, 8, 4, 5, 9, 4, 42, 0, 3, 6, 8]
    print(insertSort(a))
